<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>

<script type="text/javascript">
    dojo.require("dojo.parser");
    dojo.require("dijit.form.Button");
    dojo.require("dijit.Dialog");
    dojo.require("dijit.form.TextBox");
    function terminateEmployee(dialogFields) {
        var kw = {
                url: "terminate",
                load: function(data){
                        //dojo.byId('myBox').value = data;
                },
                error: function(data){
                        console.debug("An error occurred: ", data);
                },
                timeout: 2000,
                form: "terminateEmployeeForm"
        };
        dojo.xhrGet(kw);
    }
</script>

<div id="terminateEmployeeDialog" title="Terminate Employee" execute="terminateEmployee(arguments[0]);">
    <form:form id="terminateEmployeeForm" modelAttribute="form" action="terminate" method="post">
    <table>
        <tr>
            <td>Are you sure that you would like terminate this employee</td>
        </tr>
        <tr>
            <td colspan="2" align="center">
                <form:hidden id="terminateEmployeeId" path="person.id" />
                <button id="terminateEmployeeButton" type="submit">Terminate</button>
            </td>
        </tr>
    </table>
    </form:form>
</div>
<script type="text/javascript">
    Spring.addDecoration(new Spring.ElementDecoration({
    elementId : "terminateEmployeeDialog",
    widgetType : "dijit.Dialog"
    }))
</script>